<template>
  <span>{{ index + 1 }}: {{ result }}</span>
</template>

<script>
export default {
  props: {
    answer: Boolean,
    showResult: Boolean,
    index: Number
  },
  computed: {
    result() {
      if (!this.showResult) {
        return "未完成";
      }
      return this.answer ? "回答正确" : "回答错误";
    }
  }
};
</script>

<style scoped>
.right {
  color: green;
}
.error {
  color: red;
}
.undo {
  color: #ccc;
}
</style>